/*
The MIT License

Copyright (c) 2011 Sean M. Thomas

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
*/
#ifndef FS_CONTAINERS_H
#define FS_CONTAINERS_H

#include "fs_UniformDefines.h"

#ifdef _WIN32
#include <windows.h>
#endif

#include <GL/glew.h>
#include <GL/gl.h>
#include <glm.hpp>

using namespace glm;

typedef enum {
	RT_FORWARD,
	RT_DEFERRED,
	RT_FIXED_FUNC
} fs_renderType;

typedef struct {
	GLuint vertex_array;
	GLuint vbo_indices;
	GLuint vbo_vertices;
	GLuint vbo_normals;
	GLuint vbo_txCoord;
	GLuint vbo_colors;

	GLuint textureID;

	unsigned int num_indices;
} fs_device_mesh;

inline void fs_device_mesh_initToZero(fs_device_mesh &mesh) {
	mesh.num_indices = 0;
	mesh.textureID = 0;
	mesh.vbo_colors = 0;
	mesh.vbo_indices = 0;
	mesh.vbo_normals = 0;
	mesh.vbo_txCoord = 0;
	mesh.vbo_vertices = 0;
	mesh.vertex_array = 0;
}

typedef struct {
	vec3 kAmbient;
	vec3 kDiffuse;
	vec3 kSpecular;
	float specExp;
} fs_material;

typedef struct {
	vec3 position;
	vec3 normal;
	vec2 uvCoord;
	vec3 color;
} fs_vertex;

typedef struct {
	GLuint shader;
	GLint uniforms[U_NUM_UNIFORMS];
	GLint outAttachments[4];
} fs_shader_container;

typedef struct {
	fs_shader_container txShader;
	fs_shader_container vtShader;
} fs_first_pass_shaders;

typedef struct {
	fs_renderType rType;
	mat4 view;
	fs_first_pass_shaders sC;
} fs_first_pass_draw_options;

namespace fs_vertex_attribute {
	typedef enum {
		POSITION,
		NORMAL,
		COLOR,
		TEXCOORD,
	};
}


#endif // #ifndef FS_CONTAINERS_H